package com.sdhs.basicinfo.service.impl;

import java.util.List;

import com.sdhs.basicinfo.domain.GcFoundationAssociationUnit;
import com.sdhs.basicinfo.mapper.GcFoundationAssociationUnitMapper;
import com.sdhs.basicinfo.service.IGcFoundationAssociationUnitService;
import com.sdhs.common.utils.SecurityUtils;
import com.sdhs.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 基础信息管理-关联单位信息Service业务层处理
 *
 * @author andong
 * @date 2025-03-20
 */
@Service
public class GcFoundationAssociationUnitServiceImpl implements IGcFoundationAssociationUnitService
{
    @Autowired
    private GcFoundationAssociationUnitMapper gcFoundationAssociationUnitMapper;

    /**
     * 查询基础信息管理-关联单位信息
     *
     * @param id 基础信息管理-关联单位信息主键
     * @return 基础信息管理-关联单位信息
     */
    @Override
    public GcFoundationAssociationUnit selectGcFoundationAssociationUnitById(Long id)
    {
        return gcFoundationAssociationUnitMapper.selectGcFoundationAssociationUnitById(id);
    }

    /**
     * 查询基础信息管理-关联单位信息列表
     *
     * @param gcFoundationAssociationUnit 基础信息管理-关联单位信息
     * @return 基础信息管理-关联单位信息
     */
    @Override
    public List<GcFoundationAssociationUnit> selectGcFoundationAssociationUnitList(GcFoundationAssociationUnit gcFoundationAssociationUnit)
    {
        return gcFoundationAssociationUnitMapper.selectGcFoundationAssociationUnitList(gcFoundationAssociationUnit);
    }

    /**
     * 新增基础信息管理-关联单位信息
     *
     * @param gcFoundationAssociationUnit 基础信息管理-关联单位信息
     * @return 结果
     */
    @Override
    public int insertGcFoundationAssociationUnit(GcFoundationAssociationUnit gcFoundationAssociationUnit)
    {
		gcFoundationAssociationUnit.setCreater(SecurityUtils.getUsername());
        gcFoundationAssociationUnit.setCreateTime(DateUtils.getNowDate());
        return gcFoundationAssociationUnitMapper.insertGcFoundationAssociationUnit(gcFoundationAssociationUnit);
    }

    /**
     * 修改基础信息管理-关联单位信息
     *
     * @param gcFoundationAssociationUnit 基础信息管理-关联单位信息
     * @return 结果
     */
    @Override
    public int updateGcFoundationAssociationUnit(GcFoundationAssociationUnit gcFoundationAssociationUnit)
    {
		gcFoundationAssociationUnit.setUpdater(SecurityUtils.getUsername());
        gcFoundationAssociationUnit.setUpdateTime(DateUtils.getNowDate());
        return gcFoundationAssociationUnitMapper.updateGcFoundationAssociationUnit(gcFoundationAssociationUnit);
    }

    /**
     * 批量删除基础信息管理-关联单位信息
     *
     * @param ids 需要删除的基础信息管理-关联单位信息主键
     * @return 结果
     */
    @Override
    public int deleteGcFoundationAssociationUnitByIds(Long[] ids)
    {
        return gcFoundationAssociationUnitMapper.deleteGcFoundationAssociationUnitByIds(ids);
    }

    /**
     * 删除基础信息管理-关联单位信息信息
     *
     * @param id 基础信息管理-关联单位信息主键
     * @return 结果
     */
    @Override
    public int deleteGcFoundationAssociationUnitById(Long id)
    {
        return gcFoundationAssociationUnitMapper.deleteGcFoundationAssociationUnitById(id);
    }
}
